package cn.ixinjiu.libraryMangement.dao;

import cn.ixinjiu.libraryMangement.entity.BorrowInfo;

import java.sql.SQLException;
import java.util.List;

/**
 * Created by XinChen on 2023-05-12
 *
 * @TODO
 */
public interface IBorrowInfoDao {
    // 借阅信息列表
    List<BorrowInfo> borrowsInfo();

    List<BorrowInfo> getBorrowsInfoByUserId(int userId);

    // 借阅信息总数
    int count();

    /**
     * @param id 借阅信息id
     * @return int  返回数据，是否删除成功
     */
    int borrowInfoDel(int id);

    int borrowInfoDelByBookId(int bookId);

    /**
     * @param borrowInfo 修改后的数据
     * @return int  返回数据，是否修改成功
     */
    int borrowUpd(BorrowInfo borrowInfo);

    int borrowAdd(BorrowInfo borrowInfo);

    BorrowInfo getBorrowInfoById(int id) throws SQLException;

    BorrowInfo getBorrowInfoByBookId(int bookId);
}
